#include"Link_Stack.h"

Status Init_Link_Stack(Link_Stack& S)
{
	S = NULL;
	return OK;
}

Status Push_Link_Stack(Link_Stack& S, int e)
{
	Link_Stack p = new StackNode;
	p->data = e;
	p->next = S;
	S = p;
	return OK;
}

Status Pop_Link_Stack(Link_Stack& S, int& e)
{
	if (S == NULL) {
		return ERROR;
	}
	e = S->data;
	Link_Stack p = S;
	S = S->next;
	delete p;
	return OK;
}

int GetTop_Link_Stack(Link_Stack& S)
{
	if (S != NULL) {
		return S->data;
	}
}
